package fr.aracore.domotique.zapi.core;
import java.nio.ByteBuffer;


public class ZbResponse {
	ZbHeader header;
	public String message;
	
	
	public ZbResponse(){
		super();
	}
	public ZbResponse(byte[]response){
		this();
		ByteBuffer buf=ByteBuffer.wrap(response);
		if (response.length>=70){
			//Traitement de la header
			byte[]lcHeader=new byte[70];
			buf.get(lcHeader, 0, 70);
			this.header=new ZbHeader(lcHeader);
			//Traitement du message
			byte[]lcMessage=new byte[response.length-70];
			buf.get(lcMessage, 0, response.length-70);
			this.message=new String(lcMessage);
		}
	}
	
}
